package com.xian.wsim.enums;

public enum MessageStatus {
    SENT(1),
    DELIVERED(2),
    READ(3);

    private final int value;

    MessageStatus(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static MessageStatus fromValue(int value) {
        for (MessageStatus status : MessageStatus.values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid message status value: " + value);
    }
}